#!/bin/bash
geturl="http://rayangscripts.googlecode.com/files/snmpdiskio.tmp"
cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak
cat > /etc/snmp/snmpd.conf << EOF
com2sec notConfigUser  192.168.0.12 public
com2sec notConfigUser  localhost       public
group   notConfigGroup v1           notConfigUser
group   notConfigGroup v2c           notConfigUser
view    all            included      .1
view    systemview    included   .1.3.6.1.2.1.1
view    systemview    included   .1.3.6.1.2.1.25.1.1
access  notConfigGroup ""      any       noauth    exact  all    none   none
com2sec local     127.0.0.1/32    public
com2sec local     192.168.0.0/24   public
view all    included  .1                               80
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat
smuxpeer .1.3.6.1.4.1.674.10892.1
view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc
extend .1.3.6.1.4.1.2021.54 hdNum /usr/local/bin/snmpdiskio hdNum
extend .1.3.6.1.4.1.2021.55 hdIndex /usr/local/bin/snmpdiskio hdIndex
extend .1.3.6.1.4.1.2021.56 hdDescr /usr/local/bin/snmpdiskio hdDescr
extend .1.3.6.1.4.1.2021.57 hdInBlocks /usr/local/bin/snmpdiskio hdInBlocks
extend .1.3.6.1.4.1.2021.58 hdOutBlocks /usr/local/bin/snmpdiskio hdOutBlocks
EOF
wget ${geturl} -O snmpdiskio 
#mv snmpdiskio.sh snmpdiskio
cp snmpdiskio /usr/local/bin/
chmod 0755 /usr/local/bin/snmpdiskio
/etc/init.d/snmpd restart
